package com.myspace.controller.account;

import com.myspace.service.space.account.GetUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class GetUserInfoController {
    @Autowired
    private GetUserInfoService getUserInfoService;

    @GetMapping("/user/getinfo/")
    public Map<String, String> getUserInfo(@RequestParam Map<String, String> data) {
        Integer myId = Integer.parseInt(data.get("my_id"));
        Integer userId = Integer.parseInt(data.get("user_id"));
        return getUserInfoService.getUserInfo(myId, userId);
    }
}
